﻿using System;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;


namespace tpGo
{
    class CuadroGo
    {
        protected Pen colorLinea;//Color linea
        protected Color C1, C2;//Colores del cuadro
        protected Bitmap imagen;//Imagen de fondo
        public Point puntoInicialGrafico;//Punto inical de dibujo del cuadro
        public Size TamanioTablero;//Dimensiones
        private Size DimensionCuadro;
        String direccionImagen = @"C:\Users\matias\Desktop\InterfaceGo\madera.jpg";
        public int xInicial;
        public int xFinal;
        public int yInicial;
        public int yFinal;


        public CuadroGo(int xi,int xf,int yi, int yf)
        {      
            xInicial = xi;
            xFinal = xf;
            yInicial = yi;
            yFinal=yf;       
            colorLinea = new Pen(Color.Black);
            puntoInicialGrafico = new Point(0, 0);
            
        }

        public void DrawCuadro(Graphics G)
        {
            G.DrawRectangle(colorLinea, new Rectangle(puntoInicialGrafico, DimensionCuadro));
        }

        public void FillCuadro(Graphics G, int dimension)
        {
            DimensionCuadro = new Size(dimension, dimension);
            C1 = Color.Wheat;
            C2 = Color.Wheat;
            G.FillRectangle(new HatchBrush(HatchStyle.DashedHorizontal, C1, C2), new Rectangle(puntoInicialGrafico, DimensionCuadro));
            G.DrawRectangle(colorLinea, new Rectangle(puntoInicialGrafico, DimensionCuadro));
        }

        public void PaintCuadro(Graphics G)
        {      
            imagen = new Bitmap(direccionImagen);
            imagen = new Bitmap(imagen, new Size(45, 45));
            G.DrawImage(imagen, puntoInicialGrafico);
        }

    }
}
